package ru.ifmo.rybakov.muclumon.analysis2;

import java.util.ArrayList;
import java.util.Collection;

public class CombinationLinear extends Combination {

	private Collection<Combination> parts;
	
	public CombinationLinear(Collection<Combination> parts) {
		this.parts = parts;
	}
	
	public Function[] getFunctions() {
		ArrayList<Function> functions = new ArrayList<Function>();
		for (Combination combination : parts) {
			Function[] combinationFunctions = combination.getFunctions();
			for (Function f : combinationFunctions) {
				functions.add(f);
			}
		}
		Function[] result = new Function[functions.size()];
		functions.toArray(result);
		return result;
	}

}
